<template>
  <div class="links">
    <div class="title">页面路由</div>
    <ul>
      <li v-for="(item, key) in items" :key="key">
        <router-link :to="`/${item}`">
          {{ item }}
        </router-link>
      </li>
    </ul>
  </div>
</template>

<script>
import routes from '../routes/modules'

export default {
  name: 'Links',
  data() {
    return {
      items: []
    }
  },
  created() {
    this.items = Object.keys(routes)
  }
}
</script>

<style scoped>
.links {
  padding: 20px;
}
.title {
  width: 100%;
  padding: 20px 40px;
  margin-bottom: 40px;
  font-size: 30px;
  color: red;
  text-align: center;
}

ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 100%;
}

li {
  padding: 10px 20px;
  margin: 10px;
  font-size: 24px;
  line-height: 28px;
  text-align: center;
  list-style: none;
  border: 1px solid red;
}
</style>
